package subumbo.demo.service {
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	import mx.controls.Alert;
	
	public class AbstractService {
		
		protected var loader:URLLoader;
		protected var request:URLRequest;
		
		public function AbstractService() {
			loader = new URLLoader();
			request = new URLRequest();
		}
		
		public function send():void {
			loader.load(request);
			loader.addEventListener(Event.COMPLETE, onResult, false, 0, true);
		}
		
		protected function onResult(e:Event):void {
			loader.removeEventListener(Event.COMPLETE, onResult) 
		}
	}
}